
 beginoutdoorscript;

 variables;

int i,j,k,r1,choice;

 body;

 beginstate INIT_STATE;


	break;

 beginstate START_STATE;


	break;

 beginstate 10;
outdoor_enc_result(1);
	if ((species_in_party(3) == 0) && (get_flag(205,5) == 0)) {
		reset_dialog();
		add_dialog_str(0,"The soldiers seems nervous and tired. The sergeant, however, is thrilled to see you. Before you can ask any questions, she begins to bombard you with questions instead. She asks about Grimson and Norton and the rest of Faerengrove.",0);
	if (get_flag(6,11) == 1)
		add_dialog_str(1,"Looking at the state of the men, you decide it's best not to mention anything about the fall of Norton.",0);
		add_dialog_str(2,"You answer her questions the best you can. The answers do not please her or her men. In fact they seem more crestfallen than ever.",0);
		add_dialog_str(3,"The sergeant explains that Sattle has been under attack, by _walking lizards_. She pauses to wait for your response. When you seem unimpressed, she finishes by saying you should find Captain Remington in Sattle.",0);
		run_dialog(1);
		set_flag(205,5,2);
}


	if (species_in_party(3) < 2 && species_in_party(0) != 0 && species_in_party(3) != 0 && get_flag(205,5) == 0) {
		reset_dialog();
		add_dialog_str(0,"The group of soldiers is shifting nervously as you approach them. When you get really close you notice one of them is aiming his javelin at you!",0);
		add_dialog_str(1,"Fortunately the sergeant of the group stops the man. She barks orders to stand still and after that she approaches you. She asks questions about the _lizard_ in your party and why is _it_ with you.",0);
		add_dialog_str(2,"You answer her that the slithzerikai has been with you for many years now, and is your friend. She seems puzzled, but tells you to go to Sattle and speak with Captain Remington. She also says that, the lizards have been attacking Sattle.",0);
		run_dialog(1);
		set_flag(205,5,2);
}

	if (species_in_party(0) == 0 && species_in_party(2) == 0 && (get_flag(205,5) == 0)) {
		reset_dialog();
		add_dialog_str(0,"The soldiers seemed alarmed by you. They immediately stood their ground when they saw you. Their weapons are drawn and their sergeant looks like she is ready to order the soldiers to attack.",0);
		add_dialog_str(1,"You stop outside their crossbows' range. They are frightened of you. Perhaps they've never seen slithzerikai before.",0);
	if (has_special_item(5))
		add_dialog_choice(2,"Show them your deputation.");
		add_dialog_choice(0,"Talk to them.");
		add_dialog_choice(1,"Run for it!");
		choice = run_dialog(1);
	if (choice == 3)
		set_state_continue(20);

	if (choice == 1)
		set_state_continue(21);

	if (choice == 2)
		set_state_continue(22);
}


	if (get_flag(205,5) == 1)
		outdoor_enc_result(1);

	
 break;

 beginstate 11;
	if (get_flag(205,0) == 0) {
		message_dialog("At the bottom of the hill, you can already see one thing: The hill has been taken by slithzerikai, and it's not a small group either, you count several dozen. Brute force has gotten you far before, though.","The question arises, however, how did slith come to the surface?");
		set_flag(205,0,1);

}
 break;

 beginstate 12;
	if ((get_flag(205,1) == 0) && (get_flag(205,8) != 1)) {
		message_dialog("Suddenly charging at the sliths doesn't seem that smart. You've seen slith in your times, and you recognize strong ones. These are definitely strong and they are backed by spellcasters. This is going to get ugly.","");
		outdoor_enc_result(3);
		create_out_spec_enc(0);
		create_out_spec_enc(1);
}
	if ((get_flag(205,1) == 0) && (get_flag(205,8) == 1)) {
		message_dialog("You arrive at the battlefield. The fight is hardly over, but with your help the soldiers should be alright.","");
		outdoor_enc_result(3);
		set_creature_type_level(6,20);
		set_creature_type_level(8,22);
		create_out_spec_enc(3);
}


 break;

 beginstate 13;
	if (get_flag(205,2) == 0)
		end();

	if (get_flag(205,2) == 1) 
		message_dialog("You get ready. Another group is coming.","");
break;

 beginstate 14;
	if (get_flag(205,3) == 0) {
		reset_dialog();
		add_dialog_str(0,"The slith are cold-blooded! Of course you've known this for a while, but now you actually realize it. For some reason sliths evolved in damp, cold caves, where they had to resort to fire as a means of keeping warm. The surface must be heaven to them.",0);
		add_dialog_str(1,"You base these conclusions on the group of sliths you see in front of you. They are basking in the sun on some rock. They look very preoccupied. You could sneak up on them, or you could sneak past them.",0);
		add_dialog_choice(0,"Attack!");
		add_dialog_choice(1,"Sneak past.");
		choice = run_dialog(1);

		if (choice == 1) 
			create_out_spec_enc(2);


		if (choice == 2)
			set_state_continue(16);
}
break;

 beginstate 15;
	set_out_fight_town_loaded(18);
	message_dialog("You succeed in ambushing the slith. They seem truly bewildered!","");
	set_creature_type_level(34,10);
	set_creature_type_level(35,13);
	set_flag(205,3,1);
break;

 beginstate 16;
	message_dialog("Sneaking past the slith turns out to be easier than you imagined. They have focused so hard on sunbathing, that you think an entire army could have sneaked past them.","");
break;

 beginstate 17;
	message_dialog("You search the bodies of the slith. They don't seem to have anything of value with them. However, you take notice of the fine quality of their spears.","");
	set_creature_type_level(34,24);
	set_creature_type_level(35,28);
break;

 beginstate 18;
	set_creature_type_level(6,7);
	message_dialog("You can't believe what just happened here! You were attacked by Empire soldiers! You didn't even do anything to threaten them. This can't be good.","");
	set_flag(205,5,1);
 break;

 beginstate 19;
	if (get_flag(205,5) == 1 && species_in_party(3) > 3)
		create_out_spec_enc(3);

	if (get_flag(2,13) == 1) {
		message_dialog("You arrive at the guard station and demand to see captain Holk. He listens to what you have to say about Mahrmmrrh and then grins. _About time we get to arrest that animal! Thank ye sirs!_","_We'll make sure this is done legally of course._ Captain Holk departs with a small group of soldiers.");
		set_flag(2,13,2);
}
 break; 
	

 beginstate 20;
	reset_dialog();
	add_dialog_str(0,"You pull out the deputation, which the mayor of Grimson gave you. You shout out that you are special agents for the Empire and demand that they lower their weapons at once. The soldiers seem confused",0);
	add_dialog_str(1,"Their sergeant walks towards you, still holding on to her sword. You give her the deputation papers. She reads them and gives them back to you and mumbles. _Truly sorry sirs. Your... kind have been attacking us. Er... Sorry._",0);
	add_dialog_str(2,"Then she and her men move along. You take a moment to consider what she said. Sliths on the surface?",0);
	run_dialog(1);
	set_flag(205,5,2);

 break;

 beginstate 21;
	message_dialog("You try to talk to the soldiers, but before you manage to say a single word, the soldiers attack!","");
	set_creature_type_level(6,20);
	outdoor_enc_result(0);
 break;

 beginstate 22;
	message_dialog("You don't like what you see, so you make a run for it. You head south, off the road. Glancing back you notice the soldiers are following you. Luckily they give up after you get too far off the road. What was wrong with them?","");
	out_move_party(43,28);
 break;

 beginstate 23;
	if (get_flag(205,6) == 0 && get_skill_total(16) < 20) {
		message_dialog("Though the slith have only been on the surface for weeks, they have mastered one thing: The art of ambushing people in the forests. You didn't even hear them approach.","");
		set_flag(205,6,1);
}

	if (get_flag(205,6) == 0 && get_skill_total(16) >= 20) {
		reset_dialog();
		add_dialog_str(0,"The further you walked into this forest the quieter fauna got. The reason lies ahead of you. You notice sliths high on the trees' branches and within the bushes.",0);
		add_dialog_str(1,"If you weren't so good the sliths might have succeeded in ambushing you. However, you've spotted them now and they don't realize it.",0);
		add_dialog_choice(0,"Ambush the sliths instead.");
		add_dialog_choice(1,"Use your skill to sneak past the sliths.");
		choice = run_dialog(1);

		if (choice == 1) {
			message_dialog("You sneak into good position and charge the sliths in their backs. They don't know what hit them!","");
			set_flag(205,6,1);
			set_party_status(1,8,0);
}
		if (choice == 2)
			set_state_continue(28);
}
 break;

 beginstate 24;
	if (get_flag(205,7) == 0) {
		message_dialog("You knock on the door of the woodcutter's hut. No-one appears to be home. You step inside, only to see that everything has been taken away.","Whether the house has been raided or the owner just moved out, you can't tell.");
		set_flag(205,7,1);
}
 break;

 beginstate 25;
	if ((get_flag(5,13) > 0) && (get_flag(205,8) == 0) && (get_flag(205,9) != 2)) {
		message_dialog("You gaze at the hill, the slith had taken. You see signs of a battle. The soldiers from Sattle have assaulted the hill again. You should make haste and help the soldiers!","");
	set_flag(205,8,1);
}
 break;

 beginstate 26;
	inc_flag(205,9,1);
 break;

 beginstate 27;
	message_dialog("The soldiers have gathered their dead and are doing what they can about the wounded. The leader of the soldiers greets you with a smile. _We really showed those no good lizards, eh sirs? They really didn't stand a chance when you arrived!_","You talk with the soldiers a bit more and assist them with their wounded, then the soldiers take off towards Sattle.");
	set_creature_type_level(6,10);
	set_creature_type_level(8,12);
	set_flag(205,1,5);
 break;

 beginstate 28;
	if (get_skill_total(16) >= 25) 
		outdoor_enc_result(2); 
	if (get_skill_total(16) < 25) {
		message_dialog("You try to sneak past the sliths, but something goes wrong. Possibly you made too much sound or the sliths saw you. It doesn't matter how they spotted you, though. The sliths charge at you.","");
		set_party_status(1,-6,0);
		set_flag(205,6,1);
}
 break;
